package com.hzit.service.impl;

import com.hzit.dao.StudentMapper;
import com.hzit.pojo.Student;
import com.hzit.service.StudentService;
import com.hzit.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
public class StudentServiceImpl implements StudentService {

	public List<Student> findAll() {
		try(SqlSession sqlSession = MyBatisUtil.getSession()){
			StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
			List<Student> students = mapper.findAll();
			return students;
		}

	}
}
